#include "DLLWrapper.h"

#include "VertKinds.h"
#include "RenderInstance.h"
#include "ShaderManager.h"
#include "TextureManager.h"
#include "MeshManager.h"

bool WINAPI RendererInit(HWND hWnd)
{
	if(!hWnd)
		return false;

	RENDERER->Initialize(hWnd, true, true);
	InitVertKinds();
	
	return true;
}

void WINAPI RendererRender(void)
{
	RENDERER->Clear(1UL, D3DXCOLOR(0.1f, 0.1f, 0.1f, 1.0f));
	RENDERER->BeginScene();

	RENDERER->Render();

	RENDERER->EndScene();
	RENDERER->Present();
}

int WINAPI RendererLoadShader(const char* filename)
{
	return SHADER_MNG->LoadShader(filename);
}

int WINAPI RendererLoadTexture(const char* filename)
{
	return TEXTURE_MNG->LoadTexture(filename);
}

int WINAPI RendererLoadMesh(const char* filename)
{
	return MESH_MNG->LoadMesh(filename);
}

int WINAPI RendererAddInstance(int shader, int texture, int mesh)
{
	return RENDERER->AddRenderInstance(shader, texture, mesh);
}

void WINAPI RendererCameraRotate(float x, float y, float z)
{
	RENDERER->CameraRotate(x, y, z);
}